#pragma once
#include "baseobject.h"


class CEvent;



class CBaseCharacter :
	public CBaseObject
{
public:
	CBaseCharacter(void);
	CBaseCharacter( int HP, int AD, int AR, float AS, float MS, float HS, int type );
	virtual ~CBaseCharacter(void);

	/* IObject interface */
	virtual void Update( float fElapsedTime );
	virtual void Render( void );
	virtual bool CheckCollision( IObject* pOther );

	/* IListener interface */
	virtual void HandleEvent( CEvent* pEvent );

	/* Helpers */
	void Jump( float fJumpVelocity );
	void Knockback( tVector3D knockback );
	void Slow( float fDuration, float fPercentSlow = 1.0f );

	/* Accessors 
	*  HP - HitPoints
	*  AD - Attack Damage
	*  AR - Attack Range
	*  AS - Attack Speed
	*  MS - Movement Speed
	*  HS - Hit Stund
	*/
	int			GetBaseHP( void ) const				{	return m_nBaseHitPoints;	}
	int			GetHP( void ) const					{	return m_nHitPoints;		}
	int			GetAD( void ) const					{	return m_nAttackDamage;		}
	int			GetAR( void ) const					{	return m_nAttackRange;		}
	float		GetAS( void ) const					{	return m_fAttackSpeed;		}
	float		GetBaseMS( void ) const				{	return m_fBaseMoveSpeed;	}
	tVector3D	GetMoveDir( void ) const			{	return m_tMoveDir;			}
	float		GetMoveSpeed( void ) const			{	return m_fMoveSpeed;		}
	float		GetHS( void ) const					{	return m_fHitStun;			}
	float		GetSlowDuration( void ) const		{	return m_fSlowDuration;		}
	bool		IsSlowed( void ) const				{	return m_bIsSlowed;			}
	int			GetCharType( void ) const			{	return m_nCharType;			}
	bool		GetJumpVelocity( void ) const		{	return m_fJumpVelocity;		}


	tVector3D	GetVelocity( void );

	/* Mutators 
	*
	*/
	void		SetBaseHP( int nBaseHP )			{	m_nBaseHitPoints = nBaseHP;	}
	void		SetHP( int nHP )					{	m_nHitPoints = nHP;			}
	void		SetAD( int nAD )					{	m_nAttackDamage = nAD;		}
	void		SetAR( int nAR )					{	m_nAttackRange = nAR;		}
	void		SetAS( float fAS )					{	m_fAttackSpeed = fAS;		}
	void		SetHS( float fHS )					{	m_fHitStun = fHS;			}

	void		SetMoveDir( tVector3D tMoveDir )	{	m_tMoveDir = tMoveDir;		}
	void		SetMoveDir( float fX = 0, float fY = 0, float fZ = 0 );
	void		SetZMoveDir( float fZ )				{	m_tMoveDir.fZ = fZ;			}
	void		SetYMoveDir( float fY )				{	m_tMoveDir.fY = fY;			}
	void		SetXMoveDir( float fX )				{	m_tMoveDir.fX = fX;			}
	void		SetMoveSpeed( float fMS )			{	m_fMoveSpeed = fMS;			}

	void		SetSlowDuration( float fSD )		{	m_fSlowDuration = fSD;		}
	void		IsSlowed( bool b )					{	m_bIsSlowed = b;			}

	void		SetCharType( int nType )			{	m_nCharType = nType;		}

	void		SetJumpVelocity( float fJumpVel )	{	m_fJumpVelocity = fJumpVel;	}

	enum CHARTYPE { CHAR_BASE, CHAR_PLAYER, CHAR_ENEMY };

private:
	int			m_nCharType;
	int			m_nBaseHitPoints;
	int			m_nHitPoints;
	int			m_nAttackDamage;
	int			m_nAttackRange;
	float		m_fAttackSpeed;
	float		m_fBaseMoveSpeed;
	float		m_fMoveSpeed;
	float		m_fHitStun;
	float		m_fSlowDuration;
	bool		m_bIsSlowed;

	float		m_fJumpVelocity;

	tVector3D	m_tMoveDir;

};

